package com.tzinfo.tzt.activity.util;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.tzinfo.tzt.fragment.MyFragment;
import com.tzinfo.tzt.fragment.MyFragment0;
import com.tzinfo.tzt.fragment.MyFragment1;
import com.tzinfo.tzt.fragment.MyFragment2;

/**
 * Created by Administrator on 2014/11/12.
 */
public class HomeFragmentPageAdapter extends FragmentPagerAdapter {
    public HomeFragmentPageAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        switch (position) {
            case 0:
                MyFragment0 myFragment0 = new MyFragment0();
                return myFragment0;
            case 1:
                MyFragment1 myFragment1 = new MyFragment1();
                return myFragment1;
            case 2:
                MyFragment2 myFragment2 = new MyFragment2();
                return myFragment2;
            default:
                return null;
        }
    }

    @Override
    public int getCount() {
        return 3;
    }
}
